package constructor.flyweight;

import java.util.HashMap;

public class WebSiteFactory {
    private HashMap<String, WebSite> map = new HashMap<>();

    public ConcurrentWebSite getConcurrentWebSite(String type) {
        ConcurrentWebSite concurrentWebSite = (ConcurrentWebSite) map.get(type);
        if (concurrentWebSite == null) {
            concurrentWebSite = new ConcurrentWebSite(type);
            map.put(type, concurrentWebSite);
        }
        return concurrentWebSite;
    }

}
